package net.lahuobao.finance.dao;


import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import net.lahuobao.finance.entity.accredit.AccreditRecord;

import java.util.*;

@Repository("accreditRecordDao")
public interface AccreditRecordMapper {
    int deleteByPrimaryKey(Integer accreditRecordId);

    int insert(AccreditRecord record);

    int insertSelective(AccreditRecord record);

    AccreditRecord selectByPrimaryKey(Integer accreditRecordId);

    int updateByPrimaryKeySelective(AccreditRecord record);

    int updateByPrimaryKey(AccreditRecord record);


    ArrayList<Map<String, Object>> selectListByAccreditIdAndMonth(@Param("accreditId") Integer accreditId, @Param("month") Integer month);

    ArrayList<String> selectPreRepaymentListMonth(Integer organizationId);

    ArrayList<AccreditRecord> selectPreRepaymentListByAccreditId(Integer accreditId);

    ArrayList<AccreditRecord> getAccreditRecordListByIds(@Param("accreditRecordIdList") List<Integer> accreditRecordIdList);

    ArrayList<HashMap<String, Object>> selectPreRepaymentRelated(@Param("waybillIdList") List<Integer> waybillIdList);

    ArrayList<AccreditRecord> selectRecordListByRepaymentId(Integer repaymentId);

    ArrayList<Map<String, Object>> selectListByRepaymentId(Integer repaymentId);

    int updateAccrualEndByPrimaryKey(Integer accreditRecordId);

    ArrayList<AccreditRecord> selectALlCarriage(Integer accreditId);

    int updateAccrualStartByPrimaryKey(Integer accreditRecordId);

    AccreditRecord selectByWaybillId(Integer waybillId);

    AccreditRecord selectByCargoId(Integer cargoId);

    ArrayList<AccreditRecord> selectByWaybillIds(@Param("waybillIds") List<Integer> waybillIds);

    ArrayList<Map<String, Object>> selectListByTimeScope(@Param("from") Date from, @Param("to") Date to, @Param("organizationId") Integer organizationId);
}